/******************************************
**
** THE BUGZ JAVASCRIPT FILE
**
** 18.03.2008 : bugz
**/

/*
what this file does?

we override some of the basic functions in HTML to make life easier for the developer.
The idea is to allow fast debugging and to allow an easy enviroment to handle when in production
eventually - we will incorporate the jQuery ou similar here.

*/

// debug Object - here we add all the debug messages to a queue - then later print them out.
function Debug(){
	this.messages =new Array();
}
Debug.prototype.isObj = function (obj){
	
}

Debug.prototype.add=function(desc){
	this.messages.push(desc);
}
Debug.prototype.dump=function(){
	document.write("<div id='debug' align='center' style='color:#000;'>");
	document.write("<table border=0 cellspacing=1 cellpadding=4 bgcolor=#efefef>");
	document.write("<tr><td bgcolor=#afafef style='color:#000;'>DEBUG MESSAGE</td></tr>");
	for (var i=0;i<this.messages.length;i++){
		document.write("<tr><td bgcolor="+(i%2==0?"#efefef":"#ffffff")+" style='color:#000;'>" + this.messages[i] + "</td></tr>");
	}
	document.write("</table>");
	document.write("</div>");
}


function qs(companyId){
	var q = document.URL.split("?");
	if (q.length>1){
		
	}
}
function Navigate(){
	alert("UserProfile" + ": " + navigator.userProfile);
	alert("appCodeName" + ": " + navigator.appCodeName);
	alert("appMinorVersion" + ": " + navigator.appMinorVersion);
	alert("appName" + ": " + navigator.appName);
	alert("appVersion" + ": " + navigator.appVersion);
	alert("browserLanguage" + ": " + navigator.browserLanguage);
	alert("cookieEnabled" + ": " + navigator.cookieEnabled);
	alert("cpuClass" + ": " + navigator.cpuClass);
	alert("javaEnabled()" + ": " + navigator.javaEnabled());
	alert("language" + ": " + navigator.language);
	alert("mimetypes" + ": " + navigator.mimetypes);
	alert("onLine" + ": " + navigator.onLine);
	alert("platform" + ": " + navigator.platform);
	alert("plugins" + ": " + navigator.plugins);
	alert("systemLanguage" + ": " + navigator.systemLanguage);
	alert("userAgent" + ": " + navigator.userAgent);
	alert("userLanguage" + ": " + navigator.userLanguage);
	alert("userProfile" + ": " + navigator.userProfile);
}


/*
// Create Object
function greg(){
	var age=0;
	var sex=1;//0 - F   1 - M
}
greg.prototype.setAge=function(age){
	this.age=age;
}


var k = new greg();
k.setAge(5);
alert(k.age);
// example of overloading
greg.prototype.setAge=function(age){
	this.age=age*2;
}

k.setAge(5);
alert(k.age);
*/


old_alert = alert;
alert=function(message,title){
	
	if (title){
		underline="";
		for (var i=0;i<title.length;i++){
			underline += "=";
		}
		old_alert(title + "\n" + underline + "\n" + message);
	}else{
		old_alert(message);
	}
}

